<template>
  <div class="like">
    <div class="title">
      <div class="title-info">
        <span>猜你喜欢</span>
      </div>
    </div>
    <ul class="list">
      <li class="item" v-for="(item, index) in list" :key="index">
        <div class="left">
          <img :src="item.imgSrc" alt="">
        </div>
        <div class="right">
         <div class="info">
            <div class="name">{{item.title}}</div>
            <div class="subInfo">{{item.subInfo}}</div>
         </div>
          <div class="price">
            <span class="nowPrice"><b>{{item.nowPrice}}</b>元</span>
            <span>门市价：<s>{{item.oldPrice}}</s>元</span>
          </div>
          <div class="sale">已售{{item.saleNum}}</div>
        </div>
      </li>
    </ul>
  </div>
</template>
<script>
export default {
  name: 'HomeLike',
  props: {
    list: Array
  }
}
</script>
<style lang="scss" scoped>
  @import '../../../assets/base.scss';
  .like{
    margin-top: 20px;
    padding: 0 30px;
    background-color: #fff;
    .title{
      display: flex;
      align-items: center;
      justify-content: center;
      height: 80px;
      border-bottom: 1px solid #f5f5f5;
      .title-info{
        height: 2px;
        width: 30%;
        background-color: #ccc;
        display: flex;
        align-items: center;
        justify-content: center;
        span{
          padding: 0 20px;
          background-color: #fff;
          font-size: 20px;
        }
      }
    }
    .list{
      .item {
        padding: 15px 0;
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-top: 1px solid #ddd;
        &:first-child{
          border-top: none;
        }
        .left{
          width: 180px;
          height: 164px;
          img{
            width: 100%;
            height: 100%;
          }
        }
        .right{
          position: relative;
          flex: 1;
          margin-left: 20px; 
          height: 164px;
          display: flex;
          flex-direction: column;
          justify-content: space-between;
          .info{
            .name{
              font-size: 32px;
            }
            .subInfo{
              font-size: 24px;
              line-height: 40px;
            }
          }
          .price{
            font-size: 24px;
            .nowPrice{
              margin-right: 20px;
              color: $headerColor;
              b{
                font-size: 36px;
              }
            }
          }
          .sale{
            position: absolute;
            right: 20px;
            bottom: 15px;
            font-size: 24px;
          }
        }
      }
    }
  }
</style>
